package sample.stream;

import akka.Done;
import akka.NotUsed;
import akka.actor.ActorSystem;
import akka.stream.ActorMaterializer;
import akka.stream.Materializer;
import akka.stream.javadsl.Source;

import java.util.concurrent.CompletionStage;

/**
 * Created by shichen on 2017/12/7.
 */
public class My {
    public static void main(String[] argv) {
        ActorSystem system = ActorSystem.create("quickstart");
        Materializer materializer = ActorMaterializer.create(system);

        Source<Integer, NotUsed> source = Source.range(1,100);
        CompletionStage<Done> done = source.runForeach(i -> System.out.println(i), materializer);
    }
}
